package test

import (
	"context"
	"fmt"
	"github.com/goccy/go-json"
	"lw-shop/goods_service/proto"
)

func CategoryBrandList(goodsClient proto.GoodsClient) {
	result, err := goodsClient.CategoryBrandList(context.Background(), &proto.CategoryBrandFilterRequest{
		Pages:       1,
		PagePerNums: 3,
	})
	if err != nil {
		panic(err)
	}
	fmt.Println(result.Data)

	b, _ := json.Marshal(result.Data)
	fmt.Println(string(b))
}

func CategoryBrandList2(goodsClient proto.GoodsClient) {
	result, err := goodsClient.GetCategoryBrandList2(context.Background(), &proto.CategoryBrandRequest{CategoryId: 130366})
	if err != nil {
		panic(err)
	}
	fmt.Println(result.Data)

	b, _ := json.Marshal(result.Data)
	fmt.Println(string(b))
}

func CategoryBrandList3(goodsClient proto.GoodsClient) {
	result, err := goodsClient.GetCategoryBrandList3(context.Background(), &proto.CategoryBrandRequest{CategoryId: 130366})
	if err != nil {
		panic(err)
	}
	fmt.Println(result.Data)

	b, _ := json.Marshal(result.Data)
	fmt.Println(string(b))
}
